<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Roma::Client::RomaClient [ROMA documents]</title>
  <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;

    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }

  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )

  // ]]>
  </script>

</head>
<body>


    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Roma::Client::RomaClient</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>


                <a href="../../../files/lib/roma/client/rclient_rb.html">

                lib/roma/client/rclient.rb

                </a>


        <br />

            </td>
        </tr>


        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>

                Object

            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">

  <div id="contextContent">

    <div id="description">
      <p>
Class to access ROMA .
</p>

    </div>

   </div>


    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">

        <a href="#M000013">[]</a>&nbsp;&nbsp;

        <a href="#M000012">[]=</a>&nbsp;&nbsp;

        <a href="#M000015">add</a>&nbsp;&nbsp;

        <a href="#M000017">append</a>&nbsp;&nbsp;

        <a href="#M000019">cas</a>&nbsp;&nbsp;

        <a href="#M000026">decr</a>&nbsp;&nbsp;

        <a href="#M000020">delete</a>&nbsp;&nbsp;

        <a href="#M000024">flush_all</a>&nbsp;&nbsp;

        <a href="#M000022">get</a>&nbsp;&nbsp;

        <a href="#M000023">gets</a>&nbsp;&nbsp;

        <a href="#M000025">incr</a>&nbsp;&nbsp;

        <a href="#M000011">make_rttable</a>&nbsp;&nbsp;

        <a href="#M000009">new</a>&nbsp;&nbsp;

        <a href="#M000021">out</a>&nbsp;&nbsp;

        <a href="#M000018">prepend</a>&nbsp;&nbsp;

        <a href="#M000016">replace</a>&nbsp;&nbsp;

        <a href="#M000030">sender</a>&nbsp;&nbsp;

        <a href="#M000014">set</a>&nbsp;&nbsp;

        <a href="#M000027">stats</a>&nbsp;&nbsp;

        <a href="#M000010">update_rttable</a>&nbsp;&nbsp;

        <a href="#M000029">verbosity</a>&nbsp;&nbsp;

        <a href="#M000028">version</a>&nbsp;&nbsp;

      </div>
    </div>

  </div>

    <!-- if includes -->

    <div id="section">



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>

        <tr class="top-aligned-row context-row">
          <td class="context-item-name">default_hash_name</td>

          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>

          <td class="context-item-desc"></td>
        </tr>

        <tr class="top-aligned-row context-row">
          <td class="context-item-name">retry_count_read</td>

          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>

          <td class="context-item-desc"></td>
        </tr>

        <tr class="top-aligned-row context-row">
          <td class="context-item-name">retry_count_write</td>

          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>

          <td class="context-item-desc"></td>
        </tr>

        <tr class="top-aligned-row context-row">
          <td class="context-item-name">rttable</td>

          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>

          <td class="context-item-desc"></td>
        </tr>

        <tr class="top-aligned-row context-row">
          <td class="context-item-name">sender</td>

          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>

          <td class="context-item-desc"></td>
        </tr>

        </table>
      </div>
    </div>


    <!-- if method_list -->

    <div id="methods">

      <h3 class="section-bar">Public Class methods</h3>


      <div id="method-M000009" class="method-detail">
        <a name="M000009"></a>

        <div class="method-heading">

          <a href="#M000009" class="method-signature">

          <span class="method-name">new</span><span class="method-args">(ini_nodes,plugin_modules = nil)</span>

          </a>

        </div>

        <div class="method-description">

          <p>
ROMA client constractor .
</p>
<dl>
<dt>ini_nodes</dt><dd>ROMA nodes array

</dd>
<dt>plugin_modules</dt><dd>set plugin modules if you use .

</dd>
</dl>

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000009-source">
<pre>
    <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 27</span>
27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ini_nodes</span>,<span class="ruby-identifier">plugin_modules</span> = <span class="ruby-keyword kw">nil</span>)
28:         <span class="ruby-ivar">@retry_count_write</span> = <span class="ruby-value">10</span>
29:         <span class="ruby-ivar">@retry_count_read</span> = <span class="ruby-value">5</span>
30:         <span class="ruby-ivar">@default_hash_name</span> = <span class="ruby-value str">'roma'</span>
31: 
32:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plugin_modules</span>
33:           <span class="ruby-identifier">plugin_modules</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">plugin</span><span class="ruby-operator">|</span>
34:             <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extend</span> <span class="ruby-identifier">plugin</span>
35:           <span class="ruby-keyword kw">end</span>
36:         <span class="ruby-keyword kw">end</span>
37: 
38:         <span class="ruby-identifier">init_sender</span>
39:         <span class="ruby-identifier">update_rttable</span>(<span class="ruby-identifier">ini_nodes</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-value str">':'</span>,<span class="ruby-value str">'_'</span>)})
40:         <span class="ruby-identifier">init_sync_routing_proc</span>
41:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <h3 class="section-bar">Public Instance methods</h3>


      <div id="method-M000013" class="method-detail">
        <a name="M000013"></a>

        <div class="method-heading">

          <a href="#M000013" class="method-signature">

          <span class="method-name">[]</span><span class="method-args">(key)</span>

          </a>

        </div>

        <div class="method-description">

          <p>
Get value from ROMA .
</p>
<dl>
<dt>key</dt><dd>key for roma.

</dd>
</dl>
<p>
<tt>returen</tt>
</p>
<pre>
  value sotored roma .
  If key don't exit ROMA, return nil .
  If coneect error, throw Exception .
</pre>

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000013-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 110</span>
110:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
111:         <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
112:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000012" class="method-detail">
        <a name="M000012"></a>

        <div class="method-heading">

          <a href="#M000012" class="method-signature">

          <span class="method-name">[]=</span><span class="method-args">(key, value)</span>

          </a>

        </div>

        <div class="method-description">

          <p>
Set value to ROMA .
</p>
<dl>
<dt>key</dt><dd>key for store .

</dd>
<dt>value</dt><dd>store value .

</dd>
<dt>return</dt><dd>set status TODO: please write status list .

</dd>
</dl>

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000012-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 100</span>
100:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
101:         <span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
102:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000015" class="method-detail">
        <a name="M000015"></a>

        <div class="method-heading">

          <a href="#M000015" class="method-signature">

          <span class="method-name">add</span><span class="method-args">(key, val, expt = 0)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000015-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 118</span>
118:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">expt</span> = <span class="ruby-value">0</span>)
119:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-value str">&quot;add %s 0 %d %d&quot;</span>, <span class="ruby-identifier">expt</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">length</span>)
120:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000017" class="method-detail">
        <a name="M000017"></a>

        <div class="method-heading">

          <a href="#M000017" class="method-signature">

          <span class="method-name">append</span><span class="method-args">(key, val, expt = 0)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000017-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 126</span>
126:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">expt</span> = <span class="ruby-value">0</span>)
127:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-value str">&quot;append %s 0 %d %d&quot;</span>, <span class="ruby-identifier">expt</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">length</span>)
128:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000019" class="method-detail">
        <a name="M000019"></a>

        <div class="method-heading">

          <a href="#M000019" class="method-signature">

          <span class="method-name">cas</span><span class="method-args">(key, val, expt = 0)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000019-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 134</span>
134:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cas</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">expt</span> = <span class="ruby-value">0</span>)
135:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Unsupported yet&quot;</span>) <span class="ruby-comment cmt"># TODO</span>
136:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000026" class="method-detail">
        <a name="M000026"></a>

        <div class="method-heading">

          <a href="#M000026" class="method-signature">

          <span class="method-name">decr</span><span class="method-args">(key, val = 1)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000026-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 165</span>
165:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decr</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span> = <span class="ruby-value">1</span>)
166:         <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;decr %s %d&quot;</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>)
167:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\D/</span>
168:         <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">to_i</span>
169:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000020" class="method-detail">
        <a name="M000020"></a>

        <div class="method-heading">

          <a href="#M000020" class="method-signature">

          <span class="method-name">delete</span><span class="method-args">(key)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000020-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 138</span>
138:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
139:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;delete %s&quot;</span>)
140:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000024" class="method-detail">
        <a name="M000024"></a>

        <div class="method-heading">

          <a href="#M000024" class="method-signature">

          <span class="method-name">flush_all</span><span class="method-args">()</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000024-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 154</span>
154:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flush_all</span>()
155:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Unsupported yet&quot;</span>) <span class="ruby-comment cmt"># TODO</span>
156:         <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_flush_all_command</span>
157:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000022" class="method-detail">
        <a name="M000022"></a>

        <div class="method-heading">

          <a href="#M000022" class="method-signature">

          <span class="method-name">get</span><span class="method-args">(key)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000022-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 146</span>
146:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
147:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:value_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;get %s&quot;</span>)[<span class="ruby-value">0</span>]
148:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000023" class="method-detail">
        <a name="M000023"></a>

        <div class="method-heading">

          <a href="#M000023" class="method-signature">

          <span class="method-name">gets</span><span class="method-args">(keys)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000023-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 150</span>
150:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gets</span>(<span class="ruby-identifier">keys</span>)
151:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Unsupported yet&quot;</span>) <span class="ruby-comment cmt"># TODO</span>
152:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000025" class="method-detail">
        <a name="M000025"></a>

        <div class="method-heading">

          <a href="#M000025" class="method-signature">

          <span class="method-name">incr</span><span class="method-args">(key, val = 1)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000025-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 159</span>
159:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">incr</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span> = <span class="ruby-value">1</span>)
160:         <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;incr %s %d&quot;</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>)
161:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\D/</span>
162:         <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">to_i</span>
163:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000011" class="method-detail">
        <a name="M000011"></a>

        <div class="method-heading">

          <a href="#M000011" class="method-signature">

          <span class="method-name">make_rttable</span><span class="method-args">(node)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000011-source">
<pre>
    <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 76</span>
76:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_rttable</span>(<span class="ruby-identifier">node</span>)
77:         <span class="ruby-identifier">mklhash</span> = <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_route_mklhash_command</span>(<span class="ruby-identifier">node</span>)
78:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">mklhash</span>
79: 
80:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@rttable</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@rttable</span>.<span class="ruby-identifier">mklhash</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mklhash</span>
81:           <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@rttable</span>
82:         <span class="ruby-keyword kw">end</span>
83: 
84:         <span class="ruby-identifier">rd</span> = <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_routedump_command</span>(<span class="ruby-identifier">node</span>)
85:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rd</span>
86:           <span class="ruby-identifier">ret</span> = <span class="ruby-constant">ClientRoutingTable</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rd</span>)
87:           <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">mklhash</span> = <span class="ruby-identifier">mklhash</span>
88:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span>
89:         <span class="ruby-keyword kw">end</span>
90:         <span class="ruby-keyword kw">nil</span>
91:       <span class="ruby-keyword kw">rescue</span>
92:         <span class="ruby-keyword kw">nil</span>
93:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000021" class="method-detail">
        <a name="M000021"></a>

        <div class="method-heading">

          <a href="#M000021" class="method-signature">

          <span class="method-name">out</span><span class="method-args">(key)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000021-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 142</span>
142:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">out</span>(<span class="ruby-identifier">key</span>)
143:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;out %s&quot;</span>)
144:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000018" class="method-detail">
        <a name="M000018"></a>

        <div class="method-heading">

          <a href="#M000018" class="method-signature">

          <span class="method-name">prepend</span><span class="method-args">(key, val, expt = 0)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000018-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 130</span>
130:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepend</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">expt</span> = <span class="ruby-value">0</span>)
131:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-value str">&quot;prepend %s 0 %d %d&quot;</span>, <span class="ruby-identifier">expt</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">length</span>)
132:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000016" class="method-detail">
        <a name="M000016"></a>

        <div class="method-heading">

          <a href="#M000016" class="method-signature">

          <span class="method-name">replace</span><span class="method-args">(key, val, expt = 0)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000016-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 122</span>
122:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replace</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">expt</span> = <span class="ruby-value">0</span>)
123:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-value str">&quot;replace %s 0 %d %d&quot;</span>, <span class="ruby-identifier">expt</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">length</span>)
124:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000030" class="method-detail">
        <a name="M000030"></a>

        <div class="method-heading">

          <a href="#M000030" class="method-signature">

          <span class="method-name">sender</span><span class="method-args">(receiver, key, value ,cmd, *params)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000030-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 186</span>
186:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span> ,<span class="ruby-identifier">cmd</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">params</span>)
187:         <span class="ruby-identifier">nid</span>, <span class="ruby-identifier">d</span> = <span class="ruby-ivar">@rttable</span>.<span class="ruby-identifier">search_node</span>(<span class="ruby-identifier">key</span>)
188:         <span class="ruby-identifier">cmd2</span> = <span class="ruby-identifier">sprintf</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-node">&quot;#{key}\e#{@default_hash_name}&quot;</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">params</span>)
189: 
190:         <span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@@timeout</span>){
191:           <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_command</span>(<span class="ruby-identifier">nid</span>, <span class="ruby-identifier">cmd2</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">receiver</span>)
192:         }
193:       <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
194:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">RuntimeError</span>)
195:           <span class="ruby-ivar">@rttable</span>.<span class="ruby-identifier">proc_failed</span>(<span class="ruby-identifier">nid</span>)
196:           <span class="ruby-constant">Roma</span><span class="ruby-operator">::</span><span class="ruby-constant">Messaging</span><span class="ruby-operator">::</span><span class="ruby-constant">ConPool</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">delete_connection</span>(<span class="ruby-identifier">nid</span>)
197:         <span class="ruby-keyword kw">end</span>
198:         <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.3</span>
199:         <span class="ruby-keyword kw">retry</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">cnt</span> <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>; <span class="ruby-identifier">cnt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@retry_count_write</span>
200:         <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
201:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000014" class="method-detail">
        <a name="M000014"></a>

        <div class="method-heading">

          <a href="#M000014" class="method-signature">

          <span class="method-name">set</span><span class="method-args">(key, val, expt = 0)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000014-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 114</span>
114:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">expt</span> = <span class="ruby-value">0</span>)
115:         <span class="ruby-identifier">sender</span>(<span class="ruby-identifier">:oneline_receiver</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-value str">&quot;set %s 0 %d %d&quot;</span>, <span class="ruby-identifier">expt</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">val</span>.<span class="ruby-identifier">length</span>)
116:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000027" class="method-detail">
        <a name="M000027"></a>

        <div class="method-heading">

          <a href="#M000027" class="method-signature">

          <span class="method-name">stats</span><span class="method-args">()</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000027-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 171</span>
171:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
172:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Unsupported yet&quot;</span>) <span class="ruby-comment cmt"># TODO</span>
173:         <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_stats_command</span>
174:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000010" class="method-detail">
        <a name="M000010"></a>

        <div class="method-heading">

          <a href="#M000010" class="method-signature">

          <span class="method-name">update_rttable</span><span class="method-args">(nodes)</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000010-source">
<pre>
    <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 62</span>
62:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_rttable</span>(<span class="ruby-identifier">nodes</span>)
63:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;nodes must not be nil.&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">nodes</span>
64: 
65:         <span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">node</span><span class="ruby-operator">|</span>
66:           <span class="ruby-identifier">rt</span> = <span class="ruby-identifier">make_rttable</span>(<span class="ruby-identifier">node</span>)
67:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rt</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
68:             <span class="ruby-ivar">@rttable</span> = <span class="ruby-identifier">rt</span>
69:             <span class="ruby-keyword kw">return</span>
70:           <span class="ruby-keyword kw">end</span>
71:         }
72: 
73:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;fatal error&quot;</span>)
74:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000029" class="method-detail">
        <a name="M000029"></a>

        <div class="method-heading">

          <a href="#M000029" class="method-signature">

          <span class="method-name">verbosity</span><span class="method-args">()</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000029-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 181</span>
181:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verbosity</span>
182:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Unsupported yet&quot;</span>) <span class="ruby-comment cmt"># TODO</span>
183:         <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_verbosity_command</span>
184:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>


      <div id="method-M000028" class="method-detail">
        <a name="M000028"></a>

        <div class="method-heading">

          <a href="#M000028" class="method-signature">

          <span class="method-name">version</span><span class="method-args">()</span>

          </a>

        </div>

        <div class="method-description">

          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000028-source">
<pre>
     <span class="ruby-comment cmt"># File lib/roma/client/rclient.rb, line 176</span>
176:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version</span>
177:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Unsupported yet&quot;</span>) <span class="ruby-comment cmt"># TODO</span>
178:         <span class="ruby-ivar">@sender</span>.<span class="ruby-identifier">send_version_command</span>
179:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>

        </div>
      </div>



    </div>




  </div>

<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>
